<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div class="bjui-pageHeader">
    <form id="pagerForm" data-toggle="ajaxsearch" action="<%=request.getContextPath()%>/tea/sellerRatings/index.do" method="post">
        <input type="hidden" name="page.pageSize" value="${page.pageSize}">
        <input type="hidden" name="page.pageCurrent" value="${page.pageCurrent}">
        <input type="hidden" name="page.orderField" value="${page.orderField}">
        <input type="hidden" name="page.orderDirection" value="${page.orderDirection}">
        <div class="bjui-searchBar">
			<label>标识：</label><input type="text" name="id" value="${sellerRatings.id}" class="form-control" size="10" />
			<label>用户名：</label><input type="text" name="username" value="${sellerRatings.username}" class="form-control" size="10" />
			<label>评价时间：</label><input type="text" name="rateTime" value="${sellerRatings.rateTime}" class="form-control" size="10" />
			<button type="button" class="btn showMoreSearch" data-toggle="moresearch" data-name="custom2" title="更多查询条件"><i class="fa fa-angle-double-down"></i></button>
            <button type="submit" class="btn-default" data-icon="search">查询</button>
            <a class="btn btn-orange" href="javascript:;" data-toggle="reloadsearch" data-clear-query="true" data-icon="undo">清空查询</a>
            <div class="pull-right">
            	<button type="button" class="btn btn-green" data-url="<%=request.getContextPath()%>/tea/sellerRatings/edit.do" data-toggle="dialog" data-width="1000" data-height="600" data-id="dialog-mask" data-mask="true"><i class="fa fa-plus"></i>&nbsp;新增数据</button>&nbsp;&nbsp;
                <div class="btn-group">
                    <button type="button" class="btn-default dropdown-toggle" data-toggle="dropdown" data-icon="copy">复选框-批量操作<span class="caret"></span></button>
                    <ul class="dropdown-menu right" role="menu">
	                    <li><a href="<%=request.getContextPath()%>/tea/sellerRatings/deleteids.do" data-toggle="doajaxchecked" data-confirm-msg="确定要删除选中项吗？" data-idname="ids" data-group="ids">&nbsp;删除选中</a></li>
	                    <li class="divider"></li>
	                    <li><a href="<%=request.getContextPath()%>/tea/sellerRatings/excel.do" data-fresh="true" data-reloadWarn="true">&nbsp;导出<span style="color:green;">全部</span></a></li>
	                    <li><a href="javascript:excelids();" data-fresh="true" data-reloadWarn="true">&nbsp;导出<span style="color:red;">选中</span></a></li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="bjui-moreSearch">
			<label>成交时间：</label><input type="text" name="deliveryTime" value="${sellerRatings.deliveryTime}" class="form-control" size="10" />
			<label>得分：</label><input type="text" name="score" value="${sellerRatings.score}" class="form-control" size="10" />
			<label>类型：</label><input type="text" name="rateType" value="${sellerRatings.rateType}" class="form-control" size="10" />
			<label>内容：</label><input type="text" name="text" value="${sellerRatings.text}" class="form-control" size="10" />
			<label>头像：</label><input type="text" name="avatar" value="${sellerRatings.avatar}" class="form-control" size="10" />
			<label>推荐：</label><input type="text" name="recommend" value="${sellerRatings.recommend}" class="form-control" size="10" />
        </div>
    </form>
</div>
<div class="bjui-pageContent">
    <table data-toggle="tablefixed" data-width="100%" data-nowrap="true">
    	<thead>
    	<tr>
			<th data-order-field="id">标识</th>
			<th data-order-field="username">用户名</th>
			<th data-order-field="rateTime">评价时间</th>
			<th data-order-field="deliveryTime">成交时间</th>
			<th data-order-field="score">得分</th>
			<th data-order-field="rateType">类型</th>
			<th data-order-field="text">内容</th>
			<th data-order-field="avatar">头像</th>
			<th data-order-field="recommend">推荐</th>
			<th width="25px"><input type="checkbox" class="checkboxCtrl" data-group="ids" data-toggle="icheck" /></th>
			<th>操作</th>
    	</tr>
    	</thead>
    	<tbody>
	    	<c:forEach items="${list}" var="list">
	    	<tr>
				<td>${list.id}</td>
				<td>${list.username}</td>
				<td>${list.rateTime}</td>
				<td>${list.deliveryTime}</td>
				<td>${list.score}</td>
				<td>${list.rateType}</td>
				<td>${list.text}</td>
				<td>${list.avatar}</td>
				<td>${list.recommend}</td>
				<td><input type="checkbox" name="ids" data-toggle="icheck" value="${list.id}" /></td>
	    		<td>
	    			<a href="<%=request.getContextPath()%>/tea/sellerRatings/edit.do?id=${list.id}" class="btn btn-default" data-toggle="dialog" data-width="1000" data-height="600" data-id="dialog-mask" data-mask="true">编辑</a>
	    			<a href="<%=request.getContextPath()%>/tea/sellerRatings/delete.do?id=${list.id}" class="btn btn-red" data-toggle="doajax" data-confirm-msg="确定要删除吗？">删除</a>
	    		</td>
	    	</tr>
	    	</c:forEach>
    	</tbody>
    </table>
</div>
<script>
	function excelids() {
		var root = "<%=request.getContextPath()%>";
		var page = $(".navtabPage");
		var div;
		$.each(page,function(n,mn){
			var block = $(mn).css('display');
			if(block == "block") {
				div = $(mn);
			}
		});
		var ids = div.find('input[name="ids"]');
		var list = [];
		$.each(ids,function(s,sn){
			var checked = $(sn).is(':checked');
			if(checked) {
				list.push($(sn).val());
			}
		});
		if(list.length == 0) {
			$(this).alertmsg('info', '未选中');
			return false;
		}
		window.location=root+"/tea/sellerRatings/excelIds.do?ids="+list;
	}
</script>
<%@ include file="/App/common/pageFooter.jsp" %>